package mapper;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName order
 */
@Data
public class Order implements Serializable {
    /**
     * 主键
     */
    private String id;

    /**
     * 司机id
     */
    private String driverid;

    /**
     * 乘客id
     */
    private String passengerid;

    /**
     * 乘客发起订单时间
     */
    private Date begintime;

    /**
     * 0乘客发起；1司机接单；2乘客上车；3订单结束；-1异常
     */
    private Integer state;

    /**
     * 结束时间
     */
    private Date endtime;

    /**
     * 上车位置
     */
    private String positionstart;

    /**
     * 下车位置
     */
    private String positionend;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Order other = (Order) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDriverid() == null ? other.getDriverid() == null : this.getDriverid().equals(other.getDriverid()))
            && (this.getPassengerid() == null ? other.getPassengerid() == null : this.getPassengerid().equals(other.getPassengerid()))
            && (this.getBegintime() == null ? other.getBegintime() == null : this.getBegintime().equals(other.getBegintime()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getEndtime() == null ? other.getEndtime() == null : this.getEndtime().equals(other.getEndtime()))
            && (this.getPositionstart() == null ? other.getPositionstart() == null : this.getPositionstart().equals(other.getPositionstart()))
            && (this.getPositionend() == null ? other.getPositionend() == null : this.getPositionend().equals(other.getPositionend()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDriverid() == null) ? 0 : getDriverid().hashCode());
        result = prime * result + ((getPassengerid() == null) ? 0 : getPassengerid().hashCode());
        result = prime * result + ((getBegintime() == null) ? 0 : getBegintime().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getEndtime() == null) ? 0 : getEndtime().hashCode());
        result = prime * result + ((getPositionstart() == null) ? 0 : getPositionstart().hashCode());
        result = prime * result + ((getPositionend() == null) ? 0 : getPositionend().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", driverid=").append(driverid);
        sb.append(", passengerid=").append(passengerid);
        sb.append(", begintime=").append(begintime);
        sb.append(", state=").append(state);
        sb.append(", endtime=").append(endtime);
        sb.append(", positionstart=").append(positionstart);
        sb.append(", positionend=").append(positionend);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}